﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using QLTV_Public;

namespace QLTV_Data
{
 public   class NhaXuatBan_Data
    {
     KetNoiCSDL_Data kn = new KetNoiCSDL_Data();
     public DataTable TaoBang(string sql)
     {
         return kn.taobang(sql);
     }
     public DataTable LayDuLieu()
     {
         return kn.LayDuLieu("Load_NhaXuatBan");
     }
     public int Insert(NhaXuatBan_Public maNhaXB, NhaXuatBan_Public tenNXB, NhaXuatBan_Public ghiChu)
     {
         int Npara=3;
         string[] name = new string[Npara];
         object[]value=new object[Npara];
         name[0] = "@MaNhaXB";
         value[0] = maNhaXB.MaNhaXB;
         name[1] = "@TenNhaXB";
         value[1] = tenNXB.TenNhaXB;
         name[2] = "@GhiChu";
         value[2] = ghiChu.GhiChu;
         return kn.update("Insert_NhaXuatBan",name,value,Npara);
     }
     public int Update(NhaXuatBan_Public maNhaXB, NhaXuatBan_Public tenNXB, NhaXuatBan_Public ghiChu)
     {
         int Npara = 3;
         string[] name = new string[Npara];
         object[] value = new object[Npara];
         name[0] = "@MaNhaXB";
         value[0] = maNhaXB.MaNhaXB;
         name[1] = "@TenNhaXB";
         value[1] = tenNXB.TenNhaXB;
         name[2] = "@GhiChu";
         value[2] = ghiChu.GhiChu;
         return kn.update("Update_NhaXuatBan", name, value, Npara);
     }
     public int Delete(NhaXuatBan_Public maNhaXB)
     {
         int Npara = 1;
         string[] name = new string[Npara];
         object[] value = new object[Npara];
         name[0] = "@MaNhaXB";
         value[0] = maNhaXB.MaNhaXB;

         return kn.update("Delete_NhaXuatBan", name, value, Npara);
     }
    }
}
